-
Notifications
You must be signed in to change notification settings - Fork 54
Allow the homeserver to perform introspection using a shared secret #4808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying matrix-authentication-service-docs with
|
Latest commit: |
85be5e1
|
Status: | ✅ Deploy successful! |
Preview URL: | https://1a1e2c61.matrix-authentication-service-docs.pages.dev |
Branch Preview URL: | https://quenting-introspection-with.matrix-authentication-service-docs.pages.dev |
e603fd7
to
74bd3fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fair enough
// Basic and Bearer at the same time, so we need to parse them manually | ||
let authorization = if let Some(header) = req.headers().get(http::header::AUTHORIZATION) { | ||
let bytes = header.as_bytes(); | ||
if bytes.len() >= 6 && bytes[..6].eq_ignore_ascii_case(b"Basic ") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if bytes.len() >= 6 && bytes[..6].eq_ignore_ascii_case(b"Basic ") { | |
if bytes.starts_with(b"Basic ") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to make a case-insensitive comparison, hence the eq_ignore_ascii_case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah derp, fine :)
decoded.username().to_owned(), | ||
decoded.password().to_owned(), | ||
)) | ||
} else if bytes.len() >= 7 && bytes[..7].eq_ignore_ascii_case(b"Bearer ") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else if bytes.len() >= 7 && bytes[..7].eq_ignore_ascii_case(b"Bearer ") { | |
} else if bytes.starts_with(b"Bearer ") { |
Co-authored-by: reivilibre <[email protected]>
The intent is to simplify the setup process by only requiring a shared secret between the HS and MAS, instead of having to provision a static client for the HS.